﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StateAgent.Miner
{
    public class WorkingState : BaseState<Miner>
    {
        public override void Exit(Miner entity)
        {
            entity.workComplete = 100;
        }

        public override void Execute(Miner entity)
        {
            entity.fatigue += RandomGenerator.Rand(5);

            entity.workComplete += RandomGenerator.Rand(25);

            if (entity.workComplete >= 100)
                entity.StateMachine.ChangeState(new IdleState());
        }

        public override void Enter(Miner entity)
        {
            entity.workComplete = 0;
        }
    }
}
